package com.qing.array;

/**
 * 二维数组
 */
public class TwoDimensionArray {

    public static void main(String[] args) {
        //定义二维数组
        int[][] twoDimensionArray = new int[1][5];
        //赋值
        twoDimensionArray[0][1] = 1;
        twoDimensionArray[0][2] = 2;

        //直接声明二维数组
        int[][] twoDimensionArray1 = {{1, 2, 3}, {1, 2, 3}, {3}};

        for (int i = 0; i < twoDimensionArray1.length; i++) {
            System.out.print("\n");
            System.out.print("二维数组中第" + i + "个中的元素值为：");
            for (int j = 0; j < twoDimensionArray1[i].length; j++) {
                System.out.print(twoDimensionArray1[i][j] + "\t");
            }
        }
    }
}
